home *** CD-ROM | disk | FTP | other *** search
/ 360 Degrees of: Yellowstone National Park / 360 Degrees of: Yellowstone National Park.iso / pc / data / exhibit.cst / 00265_calculate depth scripts.ls < prev    next >
Encoding:
Text File  |  2008-04-21  |  2.1 KB  |  70 lines

  1. on calculatedepth
  2.   global depthdisplay
  3.   global clicktestcursor
  4.   global demx
  5.   global demy
  6.   global demdepth
  7.   
  8.   
  9.   --check the location of the clicktestcursor
  10.   demx = sprite(clicktestcursor).locH
  11.   demy = sprite(clicktestcursor).locV
  12.   
  13.   --adjust for the dual display offset
  14.   demy = demy-768
  15.   
  16.   if demx > 0 and demy > 0 then
  17.     --check the pixel value of the dem
  18.     demImage = member("map_dem_bw").image.duplicate()
  19.     demcolor = demImage.getPixel(demx, demy)
  20.     demdepth = demcolor.green
  21.     
  22.     --the values for this model are 2798 (highest) and 702 (lowest)
  23.     --this results in a range of 2096 meters
  24.     --2096 / 255 = 8.2196
  25.     
  26.     --recaculate and adjust
  27.     demdepth = float(float(demdepth)*8.2196)
  28.     demdepth = (demdepth + 702.0)*3.28
  29.     
  30.     put "elevation"&integer(demdepth)&" ft" into member "depth_display"
  31.     put ""&integer(demdepth)&" feet" into member "depth_display3"
  32.     put "Current Elevation: "&integer(demdepth)&" feet" into member "depth_display2"
  33.     put ""&integer(demdepth-8395)&" ft" into member "depth_display3"
  34.     put ""&integer(demdepth-7505)&" ft" into member "depth_display4"
  35.     
  36.     if sprite(clicktestcursor).locH < 1050 then
  37.       sprite(depthdisplay).locH = sprite(clicktestcursor).locH+20
  38.       sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH+20+50
  39.       
  40.     end if
  41.     if sprite(clicktestcursor).locH > 1049 then
  42.       sprite(depthdisplay).locH = sprite(clicktestcursor).locH-35
  43.       sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH-35+50
  44.       
  45.     end if
  46.     if sprite(clicktestcursor).locH > 2000 then
  47.       sprite(depthdisplay).locH = sprite(clicktestcursor).locH-80
  48.       sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH-80+50
  49.     end if
  50.     
  51.     if sprite(clicktestcursor).locV < 60 then
  52.       sprite(depthdisplay).locV = sprite(clicktestcursor).locV+30
  53.       sprite(depthdisplay-1).locV = sprite(clicktestcursor).locV+30+30
  54.     end if
  55.     if sprite(clicktestcursor).locV > 59 then
  56.       sprite(depthdisplay).locV = sprite(clicktestcursor).locV-70
  57.       sprite(depthdisplay-1).locV = sprite(clicktestcursor).locV-70+30
  58.     end if
  59.     
  60.     
  61.     
  62.   end if
  63.   
  64.   
  65.   
  66. end
  67.  
  68.  
  69.  
  70.